package org.lanqiao.tjut.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.lanqiao.tjut.bean.TBAdminsBean;
import org.lanqiao.tjut.db.DBFactory;

public class UserLoginModel {
	/**
	 * 登录验证信息查询
	 * @param adminB
	 *           登录信息
	 * @return 返回查询结果集
	 */
	public List<TBAdminsBean> getUserLginInfo(TBAdminsBean adminB) {

		String strSql = "select * from TBADMINS where ADMINS_NAME=? and ADMINS_PSW=?";

		List<Object> lstDepts = new ArrayList<>();
		lstDepts.add(adminB.getAdmins_name());
		lstDepts.add(adminB.getAdmins_psw());
		List<TBAdminsBean> lstAdmins = DBFactory.getDBDriverInstance().query(strSql,
				new BeanListHandler<>(TBAdminsBean.class), lstDepts.toArray());
		return lstAdmins;
	}
}
